<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Rice mall</title>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" type="text/css" />
		<script src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script src="${pageContext.request.contextPath}/js/bootstrap.min.js" type="text/javascript"></script>
		<style>
			.lv{
				color: black;
			}
		</style>

	</head>

	<body >
		<div class="container-fluid">

           <!--静态导入-->
			<%@include file="header.jsp"%>

			<!--
            	描述：轮播条
            -->
			<div class="container-fluid">
				<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
					<!-- Indicators -->
					<ol class="carousel-indicators">
						<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
						<li data-target="#carousel-example-generic" data-slide-to="1"></li>
						<li data-target="#carousel-example-generic" data-slide-to="2"></li>
					</ol>

					<!-- Wrapper for slides -->
					<div class="carousel-inner" role="listbox" >

						<div class="item active">
							<img src="${pageContext.request.contextPath}/img/3.jpg">
							<div class="carousel-caption">

							</div>
						</div>

						<div class="item">
							<img src="${pageContext.request.contextPath}/img/4.jpg">
							<div class="carousel-caption">

							</div>
						</div>

						<div class="item">
							<img src="${pageContext.request.contextPath}/img/5.jpg">
							<div class="carousel-caption">

							</div>
						</div>

					</div>

					<!-- Controls -->
					<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
						<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
						<span class="sr-only">Previous</span>
					</a>
					<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
						<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
						<span class="sr-only">Next</span>
					</a>
				</div>
			</div>
			<!--
            	描述：商品显示
            -->
			<div class="container-fluid" >
				<div class="col-md-12" >
					<h2 style="background: snow">最新商品&nbsp;&nbsp;<img src="${pageContext.request.contextPath}/img/title2.jpg"/></h2>
				</div>
				<div class="col-md-2" style="border:1px solid #E7E7E7;border-right:0;padding:0;">
					<img src="${pageContext.request.contextPath}/products/hao/big01.jpg" width="205" height="404" style="display: inline-block;"/>
				</div>
				<div class="col-md-10">
					<div class="col-md-6" style="text-align:center;height:200px;padding:0px;">
						<a href="${pageContext.request.contextPath}/${product.pimage}">
							<img src="${pageContext.request.contextPath}/products/hao/middle01.jpg" width="516px" height="200px" style="display: inline-block;">
						</a>
					</div>

		<c:forEach items="${nList}" var="n">
			<div class="col-md-2" style="text-align:center;height:200px;padding:10px 0px;">
				<a href="${pageContext.request.contextPath}/product?methodName=getProduct&pid=${n.pid}">
					<img src="${n.pimage}" width="130" height="130" style="display: inline-block;">
				</a>
					<%--
						${fn:substring(<string>, <beginIndex>, <endIndex>)} 函数库中的截取功能 商品名称比较长
					--%>
				<p><a href="${pageContext.request.contextPath}/product?methodName=getProduct&pid=${n.pid}" style='color:red'>${fn:substring(n.pname,0 ,5 )}...</a></p>
				<p><font color="#E4393C" style="font-size:16px">￥${n.shop_price}</font></p>
			</div>
		</c:forEach>

				</div>
			</div>
			<!--
            	描述：广告部分
            -->
            <div class="container-fluid">
				<img src="${pageContext.request.contextPath}/products/hao/ad.jpg" width="100%"/>
			</div>
			<!--
            	描述：商品显示
            -->
			<div class="container-fluid">
				<div class="col-md-12">
					<h2 style="background: snow">热门商品&nbsp;&nbsp;<img src="${pageContext.request.contextPath}/img/title2.jpg"/></h2>
				</div>
				<div class="col-md-2" style="border:1px solid #E7E7E7;border-right:0;padding:0;">
					<img src="${pageContext.request.contextPath}/products/hao/big01.jpg" width="205" height="404" style="display: inline-block;"/>
				</div>
				<div class="col-md-10">
					<div class="col-md-6" style="text-align:center;height:200px;padding:0px;">
						<a href="${pageContext.request.contextPath}/${product.pimage}">
							<img src="${pageContext.request.contextPath}/products/hao/middle01.jpg" width="516px" height="200px" style="display: inline-block;">
						</a>
					</div>

			<c:forEach items="${hList}" var="hot">
			<div class="col-md-2" style="text-align:center;height:200px;padding:10px 0px;">
				<a href="${pageContext.request.contextPath}/product?methodName=getProduct&pid=${hot.pid}">
					<img src="${hot.pimage}" width="130" height="130" style="display: inline-block;">
				</a>
				<p>
					<a href="${pageContext.request.contextPath}/product?methodName=getProduct&pid=${hot.pid}" style='color:red'>${fn:substring(hot.pname,0 ,5 )}...</a>
				</p>
				<p>
					<font color="#E4393C" style="font-size:16px">￥${hot.shop_price}</font>
				</p>
			</div>
			</c:forEach>



				</div>
			</div>			
			<!--
            	描述：页脚部分
            -->
			<div class="container-fluid">
				<div style="margin-top:50px;">
					<img src="${pageContext.request.contextPath}/img/foot.jpg" width="100%" height="78" alt="我们的优势" title="我们的优势" />
				</div>
		
				<div style="text-align: center;margin-top: 5px;">
					<ul class="list-inline">
						<li><a href="#"class="lv">百度首页</a></li>
						<li><a href="#" class="lv">联系我们</a></li>
						<li><a class="lv">招贤纳士</a></li>
						<li><a class="lv">法律声明</a></li>
						<li><a href="#" class="lv">友情链接</a></li>
						<li><a class="lv">支付方式</a></li>
						<li><a class="lv">配送方式</a></li>
						<li><a class="lv">服务声明</a></li>
						<li><a class="lv">广告声明</a></li>
					</ul>
				</div>
				<div style="text-align: center;margin-top: 10px;margin-bottom:20px; color: black">
					Copyright &copy;2020-2030  Rice mall
				</div>
			</div>
		</div>
	</body>

</html>